package edu.hunau.cxb.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * @author hb
 * @create 2020-03-27 10:54
*/
@Controller
public class RestTestController {

    @RequestMapping(value="/testRESTGet/{id}",method = RequestMethod.GET)
    public String testRESTGet(@PathVariable("id") Integer id){
        System.out.println("testRESTGet id=" + id);
        return "success";
    }

    @RequestMapping(value="/testRESTPost",method = RequestMethod.POST)
    public String testRESTPost( Integer id){
        System.out.println("testRESTPost id=" + id);
        return "success";
    }

    @RequestMapping(value="/testRESTPut/{id}",method = RequestMethod.PUT)
    public String testRESTPut(@PathVariable("id") Integer id){
        System.out.println("testRESTPut id=" + id);
        return "success";
    }

    @RequestMapping(value="/testRESTDelete/{id}",method = RequestMethod.DELETE)
    public String testRESTDelete(@PathVariable("id") Integer id){
        System.out.println("testRESTDelete id=" + id);
        return "success";
    }

}
